namespace Library
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    [ToolboxBitmap(typeof(System.Windows.Forms.Button))]
    public class Button : System.Windows.Forms.Button
    {
        private bool _bHaveAction = false;
        private string _ClickEvent = null;
        private string _DoubleEvent = null;
        private string _FillColorName = null;
        private string _format = "{0:F2}单位";
        private string _heightName = null;
        private Color _newFillColor = Color.Red;
        private Color _oldFillColor = Color.DarkGray;
        private string _textName = null;
        private bool _visible = true;
        private string _visibleName = null;
        private string _widthName = null;
        private string _xName = null;
        private string _yName = null;
        private IContainer components = null;
        public bool isRuntime = false;

        public Button()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }

        public bool bHaveAction
        {
            get
            {
                return this._bHaveAction;
            }
            set
            {
                this._bHaveAction = value;
            }
        }

        public string ClickEvent
        {
            get
            {
                return this._ClickEvent;
            }
            set
            {
                this._ClickEvent = value;
            }
        }

        public string DoubleEvent
        {
            get
            {
                return this._DoubleEvent;
            }
            set
            {
                this._DoubleEvent = value;
            }
        }

        public string FillColorName
        {
            get
            {
                return this._FillColorName;
            }
            set
            {
                this._FillColorName = value;
            }
        }

        public string Format
        {
            get
            {
                return this._format;
            }
            set
            {
                this._format = value;
            }
        }

        public string heightName
        {
            get
            {
                return this._heightName;
            }
            set
            {
                this._heightName = value;
            }
        }

        [Category("行为"), Description("确定该控件是可见的还是隐藏的")]
        public bool isVisible
        {
            get
            {
                return this._visible;
            }
            set
            {
                this._visible = value;
                if (this.isRuntime)
                {
                    base.Visible = this._visible;
                }
            }
        }

        public Color newFillColor
        {
            get
            {
                return this._newFillColor;
            }
            set
            {
                this._newFillColor = value;
            }
        }

        public Color oldFillColor
        {
            get
            {
                return this._oldFillColor;
            }
            set
            {
                this._oldFillColor = value;
            }
        }

        public string textName
        {
            get
            {
                return this._textName;
            }
            set
            {
                this._textName = value;
            }
        }

        public string visibleName
        {
            get
            {
                return this._visibleName;
            }
            set
            {
                this._visibleName = value;
            }
        }

        public string widthName
        {
            get
            {
                return this._widthName;
            }
            set
            {
                this._widthName = value;
            }
        }

        public string xName
        {
            get
            {
                return this._xName;
            }
            set
            {
                this._xName = value;
            }
        }

        public string yName
        {
            get
            {
                return this._yName;
            }
            set
            {
                this._yName = value;
            }
        }
    }
}

